<?php

defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');

class admin_employeeModelinfo extends JModel 
{
    function info_em($id)
    {
        $db = &JFactory::getDbo();
        $sql = "
            select us.username, us.name as name_us, pf.*, br.name as name_br, fu.name as name_fu
            from #__users us, #__hc_emplyee_profile pf,#__hc_access ac,#__hc_branch br, #__hc_function fu
            where us.id = pf.id_user 
            and ac.id_user = us.id
            and ac.id_branch = br.id
            and ac.id_function = fu.id
            and pf.deleted=0
            and pf.id_user = '".$id."'
        ";
        $db->setQuery($sql);
        return $db->loadObject();
    }
}
?>

